package com.lizhen.createpattern.abstractfactorypattern.impl;

import com.lizhen.createpattern.abstractfactorypattern.AbstractFactory;
import com.lizhen.createpattern.abstractfactorypattern.Color;
import com.lizhen.createpattern.abstractfactorypattern.Shape;

public class ShapeFactory extends AbstractFactory {
    public ShapeFactory() {
    }

    protected Shape getShape(String shapeType) {
        if (shapeType == null) {
            return null;
        } else if (shapeType.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        } else if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        } else {
            return shapeType.equalsIgnoreCase("SQUARE") ? new Square() : null;
        }
    }

    protected Color getColor(String color) {
        return null;
    }
}
